package com.topscomm.mpm.script;

import com.topscomm.basic.exception.MessageException;
import com.topscomm.cbo.pojo.CboApprovalNodeInsEntity;
import com.topscomm.mpm.MpmScript;
import com.topscomm.mpm.pojo.MpmProjectTeamEntity;
import com.topscomm.mpm.service.impl.MpmProjectCirculatedService;
import com.topscomm.mpm.service.impl.MpmProjectTeamService;
import com.topscomm.pub.util.ConvertUtil;
import com.topscomm.pub.util.SpringUtil;
import com.topscomm.pub.util.StringBufferProxy;
import com.topscomm.tap.ITapService;
import com.topscomm.tap.TapEntity;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author chengengwei
 * @date 2021-07-16
 * @description:
 * @modify:
 */
public class MpmProjectCirculatedMemberScript extends MpmScript {

    /**
     * @author: chengengwei
     * @date: 2021-07-16
     * @description:对项目成员发送消息
     * @modify:
     */
    @Transactional
    public void sendMessageToMember(ITapService service, TapEntity entity)throws Exception{
        //审批节点实例
        CboApprovalNodeInsEntity nodeins = (CboApprovalNodeInsEntity) entity;
        String sourceid = ConvertUtil.convertToString(nodeins.getSourceid());
        MpmProjectCirculatedService mpmProjectCirculatedService = (MpmProjectCirculatedService) SpringUtil
                .getBean("mpmProjectCirculatedService");
        mpmProjectCirculatedService.sendMessageToMember(sourceid);
    }

}
